<%@ include file="/webapis/ui/doctype.jspf" %>

<%@ taglib uri="/bbNG" prefix="bbNG"%>
<%@ taglib uri="/bbData" prefix="bbData"%>
<%@ taglib prefix='c' uri="http://java.sun.com/jsp/jstl/core" %>  
<%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %> 

<script src="../dist/js/jquery-3.1.1.min.js" type="text/javascript"></script>

<fmt:setLocale value="${locale}"/> 
<fmt:bundle basename="messages"/>
<bbNG:genericPage>

<bbNG:jsBlock>
<script type="text/javascript">
jQuery.noConflict();

function exportCredit(){

	var importParam = "";
	
    jQuery.ajax({
    	async: false,
        url: "../exportCreditresult/exportAll",    
        contentType:"application/json",   
        dataType: "text",
        type: "POST",
        data:importParam,     
        success: function (result) {
           alert(result+"success");
    },
       error: function (e) {
          alert("failed"+e);
       }
    });  
}

</script>
</bbNG:jsBlock>

<bbNG:breadcrumbBar  environment="sys_admin" navItem="admin_main">
<fmt:message key="index" var="index"/>
<bbNG:breadcrumb href="../index">index</bbNG:breadcrumb>
</bbNG:breadcrumbBar>

<bbNG:actionControlBar>
<%-- <input type="button" class="genericButton" onclick="importCourse()" value="${title}"/>
 --%>
 <fmt:message key="export.credit" var="title"/>
 <bbNG:actionButton id="importAction" url="../exportCreditresult/showExportResult" title="${title}" onClick = "exportCredit()" primary="true"/>
 
</bbNG:actionControlBar>

<form id = "collapsibleList" action="../course/importCourse">
<bbNG:inventoryList collection="${list}" initialSortCol="userId" objectVar="tmpCourseResult" className="cn.com.blackboard.SISIntergrationBiz.model.CourseCreditExportResult" url="">

<fmt:message key="courseId" var="courseId"/>
<bbNG:listElement label="${courseId}" name="courseId" comparator="${courseidComparator}" isRowHeader="true">
    <%=tmpCourseResult.getCourseId()%>
	<input TYPE="hidden" NAME="courseIdValue" VALUE="${tmpCourseResult.getCourseId()}">
</bbNG:listElement>

<fmt:message key="exportStatus" var="exportStatus"/>
<bbNG:listElement label="${exportStatus}" name="exportStatus"  >
    <%=tmpcourse.getExportStatus()%>    
	<input TYPE="hidden" NAME="exportStatusValue" VALUE="${tmpcourse.getDepartmentId()}">
</bbNG:listElement>

<bbNG:listOptions allowRefresh="true" refreshUrl="javascript:validateRefresh()" allowShowAll="true"/>

</bbNG:inventoryList>
</form>

<fmt:message key="strButOk" var="strButOk"/>
<bbNG:button id = "refreshBtn" type="PageLevel" label="${strButOk}" url="../index"/>


</bbNG:genericPage>


